package educationaladministrationsystem.CSM.Mapper.StudentAndTeacher.Student;

import educationaladministrationsystem.Class.Course;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface StudentGradeInquiryMapper {
    @Select("select * from course where id in (select classId from studentwithcourse where studentId=#{id} and CPA is not null) limit #{page},#{pageNumber}")
    List<Course> getCourseGrade(String id, int page, int pageNumber);

    @Select("select CPA,GPA from studentwithcourse where studentId=#{studentId} and classId=#{classId}")
    Map<Double, Double> getCPA(String studentId, String classId);

    @Select("select count(*) from studentwithcourse where studentId=#{id} and CPA is not null")
    int getPageSum(String id);
}
